home *** CD-ROM | disk | FTP | other *** search
- <?php
- /**
- * Web based SQLite management
- * @package SQLiteManager
- * @author FrΘdΘric HENNINOT
- * @version $Id: main.php,v 1.22 2004/09/17 09:03:08 freddy78 Exp $ $Revision: 1.22 $
- */
-
- session_start();
- ob_start();
- include_once "./include/defined.inc.php";
- include_once INCLUDE_LIB."config.inc.php";
-
-
- if(empty($dbsel) && ( !isset($GLOBALS["action"]) || ($GLOBALS["action"]!="auth") || (($GLOBALS["action"]=="auth") && !$SQLiteManagerAuth->isAdmin()) )){
- displayHeader("main");
-
- ?>
- <h2><?php echo $traduct->get(2)." ".SQLiteManagerVersion ?></h2>
- <h4><?php echo $traduct->get(3)." ".$SQLiteVersion ?> / <?php echo $traduct->get(150)." ".phpversion() ?></h4>
- <?php if(READ_ONLY) echo "<table width=80% align='center'><tr><td style='font-size: 10px; border: 1px solid red; color: red; align: center'>".$traduct->get(154)."</td></tr></table>"; ?>
-
- <table align="center" width=90% cellspacing=5 cellpadding=5>
- <tr>
- <td width=50% align="center" class="boxtitle">SQLite
- </td>
- <td width=50% align="center" class="boxtitle">SQLiteManager
- </td>
- </tr>
- <tr>
- <td nowrap="nowrap"><?php include INCLUDE_LIB."add_database.php"; ?></td>
-
- <td align="left" nowrap="nowrap"><form action="" method="POST"> <?php echo $traduct->get(141); ?> :
- <select name="Langue" onChange="submit()"><?php echo getAvailableLanguage(); ?></select><br><br>
- <?php echo $traduct->get(142); ?> :
- <select name="Theme" onChange="submit()"><?php echo getAvailableTheme(); ?></select></form><br>
- » <a href="http://www.sqlite.org/" target="docs" class="Browse"><?php echo $traduct->get(4); ?></a>
- <br> » <a href="http://www.sqlite.org/lang.html" target="docs" class="Browse"><?php echo $traduct->get(5); ?></a>
- </td>
- </tr>
- <tr>
- <td colspan=2>
- <?php if(WITH_AUTH){ ?> <hr style="border: 1px dashed blue"> <?php } ?>
- <div >
- <?php if(!READ_ONLY && WITH_AUTH && $SQLiteManagerAuth->isAdmin()) { ?>
- » <a href="?action=auth" class="Browse"><?php echo $traduct->get(156); ?></a>
- <?php } ?>
- <?php if(!READ_ONLY && WITH_AUTH && ALLOW_CHANGE_PASSWD) {
- if($GLOBALS["action"] != "passwd") { ?>
- <br>» <a href="main.php?action=passwd" class="Browse"><?php echo $traduct->get(157); ?></a><br><br>
- <?php } else {
- // manage passwd
- echo "<blockquote>";
- $SQLiteManagerAuth->changePasswd();
- echo "</blockquote>";
- } }
- if(WITH_AUTH){
- ?>
- » <a href="index.php?action=logout" target="_parent" class="Browse"><?php echo $traduct->get(158); ?></a>
- <?php } ?>
- </div>
- </td>
- </tr>
- </table>
- <?php
- } elseif(!isset($GLOBALS["action"]) || ($GLOBALS["action"]!="auth")) {
- // gestion de la base selectionnΘ
- include_once INCLUDE_LIB."SQLiteDbConnect.class.php";
- $workDb = &new SQLiteDbConnect($tabInfoDb["location"]);
- $workDb->includeUDF();
- displayHeader("main");
- displayMenuTitle();
-
- switch($action){
- case "":
- case "properties":
- default:
- if($table || $TableName) $fileProp = "tableproperties";
- elseif($view || $ViewName) $fileProp = "viewproperties";
- elseif($trigger || $TriggerName) $fileProp = "triggerproperties";
- elseif($function) $fileProp = "functproperties";
- else $fileProp = "dbproperties";
- include_once INCLUDE_LIB.$fileProp.".php";
- break;
- case "browseItem":
- include INCLUDE_LIB."browse.php";
- break;
- case "sql":
- include INCLUDE_LIB."sql.php";
- break;
- case "export":
- include_once INCLUDE_LIB."SQLiteExport.class.php";
- $export =& new SQLiteExport($workDb);
- break;
- case "del":
- $query = "DELETE FROM database WHERE id=".$dbsel.";";
- if($dbsel) {
- SQLiteExecFunction($db, $query);
- // Remove attached databases
- SQLiteExecFunction($db, "DELETE FROM attachment WHERE base_id=".$dbsel." OR attach_id=".$dbsel);
- }
- $redirect = "<script>parent.location='index.php';</script>";
- break;
- case "add_view":
- $action = "add";
- include_once INCLUDE_LIB."viewproperties.php";
- break;
- case "add_trigger":
- $action = "add";
- include_once INCLUDE_LIB."triggerproperties.php";
- break;
- case "add_function":
- $action = "add";
- include_once INCLUDE_LIB."functproperties.php";
- break;
- case "options":
- include_once INCLUDE_LIB."SQLiteDbOption.class.php";
- $Option =& new SQLiteDbOption($workDb);
- break;
- }
- } elseif(isset($GLOBALS["action"]) && ($GLOBALS["action"]=="auth")){
- displayHeader("main");
- $SQLiteManagerAuth->manageAuth();
- }
- if(isset($workDb) && $workDb->connId && ($workDb->baseName!=":memory:")) {
- $workDb->close();
- @sqlite_close($db);
- }
-
- if(isset($redirect) && !empty($redirect)){
- ob_end_clean();
- echo $redirect;
- }
- ob_end_flush();
- ?>
-